package com.foreveross.fetl.common.vo;

import java.util.Date;
import java.util.List;

import com.foreveross.fetl.util.FetlErrorUtils;
import com.foreveross.fetl.util.StringUtils;

/**
 * 预处理详细错误信息，保存到Hbase中 ，表  FETL_ERROR_MESSAGE
 * rowkey: 预处理类型 +   在处理时间段 +    生成时间 +      随机数
 * 		   17001        2014072510       105525274       84290
 * 			5位                       yyyyMMddHH(10)    HHmmssSSS(9)   5位
 * 							
 * @author windows
 *
 */
public class FetlErrorMessage {
	
	private String id;
	
	private String startRowKey;
	
	private String endRowkey;
	
	private String fetlName;
	
	private String fetlCode;
	
	private String fetlClass;
	
	private Date excuteTime;
	
	private String errorMessage;
	
	private String errorClass;
	
	private String grabDate;
	
	private List<String> keys;
	
	public static FetlErrorMessage createFetlErrorMessage(String fetlCode,String fetlClass,String grabDate,Exception e){
		FetlErrorMessage vo =new FetlErrorMessage();
		vo.setFetlClass(fetlClass);
		vo.setFetlCode(fetlCode);
		vo.setGrabDate(grabDate);
		vo.setFetlName(FetlErrorUtils.fetlNameMap.get(fetlCode));
		vo.setExcuteTime(new Date());
		vo.setErrorClass(e.getClass().getName());
		vo.setErrorMessage(StringUtils.getStackTrace(e));
		return vo;
	}

	
	
	public String getId() {
		return id;
	}



	public void setId(String id) {
		this.id = id;
	}



	public String getStartRowKey() {
		return startRowKey;
	}

	public void setStartRowKey(String startRowKey) {
		this.startRowKey = startRowKey;
	}

	public String getEndRowkey() {
		return endRowkey;
	}

	public void setEndRowkey(String endRowkey) {
		this.endRowkey = endRowkey;
	}

	public String getFetlName() {
		return fetlName;
	}

	public void setFetlName(String fetlName) {
		this.fetlName = fetlName;
	}

	public String getFetlCode() {
		return fetlCode;
	}

	public void setFetlCode(String fetlCode) {
		this.fetlCode = fetlCode;
	}

	public String getFetlClass() {
		return fetlClass;
	}

	public void setFetlClass(String fetlClass) {
		this.fetlClass = fetlClass;
	}

	public Date getExcuteTime() {
		return excuteTime;
	}

	public void setExcuteTime(Date excuteTime) {
		this.excuteTime = excuteTime;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public String getErrorClass() {
		return errorClass;
	}

	public void setErrorClass(String errorClass) {
		this.errorClass = errorClass;
	}

	public List<String> getKeys() {
		return keys;
	}

	public void setKeys(List<String> keys) {
		this.keys = keys;
	}

	public String getGrabDate() {
		return grabDate;
	}

	public void setGrabDate(String grabDate) {
		this.grabDate = grabDate;
	}
	
	

}
